<!--{Atemplate tpl/header}-->

<!--{eval echo $this->Ahtml_js_aurl();}-->
<script>
var columns = {"$this->model->table":$column_json};
function checkall(value) {
	if(value=='0'){
		jQuery(".checkbox").attr("checked","checked");
		jQuery("#chkall_del").removeAttr("disabled","disabled");
	}
	if(value=='1'){
		jQuery(".checkbox").removeAttr("checked","checked");
		jQuery("#chkall_del").attr("disabled","disabled");
	}
	if(value=='auth'){
		var chkall = jQuery("input:checked").val();
		if(chkall == null){
			alert('请先选择');
			return false;
		}else{
			return true;
		}
	}
}
var Aform = new Apps.form('','Aform',{'add':{width:640,height:'auto'}},columns.$this->model->table,{info:'$this->Amodr-info-',save:'$this->Amodr-save-one'});
jQuery(function(){
	jQuery(".checkbox").change(function (){
		if(jQuery("input:checked").val()){
			jQuery("#chkall_del").removeAttr("disabled","disabled");
		}else{
			jQuery("#chkall_del").attr("disabled","disabled");
		}
	});
})
</script>
<div class="_qq">
<form action="" method="get" class="_crmtop">
	<input type="button" value="栏目设置" onclick="Aform.column()"/>
	<input type="button" value="添加" onclick="Aform.add(0,'添加')"/>
</form>
<div class="_data_column dis_none">
	<div class="_list">$column_html</div>
	<input type="submit" value="确定"/>
</div>
<form action="" method="POST">
<table class="-table">
	<tr class="th">
		<!--{if $this->Aact=='list'}-->
		<th><b>员工</b></th>
		<!--{/if}-->
	<!--{loop $column $key $val}-->
		<th><b><a href="$page->theurl-aorder-$key,$pages->neworder$pages->other">$val</a></b></th>
	<!--{/loop}-->
	</tr>
<!--{loop $list $key $val}-->
<!--{eval
$mid = $val->$key_name;
}-->
	<tr class="_tr" id="$mid">
	<!--{if $this->Aact=='list'}-->
		<td>$val->username</td>
	<!--{/if}-->
		<!--{eval echo $obj->for_html($key,$val,$column,$this->model,'Aform');}-->
		<input type="hidden" name="save[{$key}][id]" size="1" value="$val->id">
	</tr>
<!--{/loop}-->
	<tr>
		<td colspan="100">
			<input type="button" onclick="javascript:checkall(0);" value="全选" >
			<input type="button" onclick="javascript:checkall(1);" value="反选">
			<input type="submit" id="chkall_del" value="删除选择" onClick="javascript:form.action='$this->Amodr-delall';" />
		</td>
	</tr>
</table>
</form>
</div>

<!--{Atemplate tpl/nofooter}-->